<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>高校教材管理系统</title>
    <%@ include file="./model/link.jsp" %>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/smooth-sliding-menu.js"></script>
</head>

<body>
    <%@ include file="./model/userInfoModel.jsp" %>

    <!-- 导航栏 -->
    <%@ include file="./model/nav.jsp" %>
    <!-- 导航栏 /-->
    <div id="tip" style="position:fixed;"></div>
    <!-- 版心 -->

    <div class="wrapper">
        <%@ include file="./model/Leftnav.jsp" %>
        <div class="page-content">
            <div class="content container">
                <div class="widget" style="overflow: inherit;">
                    <div class="widget-header">
                        <i class="icon-list-ol"></i>
                        <h3>班级领用教材记录</h3>
                    </div>

                    <div class="widget-content">
                        <table class="table table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th>领用单编号</th>
                                    <th>书籍封面</th>
                                    <th>书名</th>
                                    <th>分类</th>
                                    <th>出版社</th>
                                    <th>入库单编号</th>
                                    <th>领用班级</th>
                                    <th>领用数量</th>
                                    <th>领用时间</th>
                                    <th></th>
                                </tr>
                            </thead>
                            <tbody>
                               <c:forEach items="${BookReceive}" var="receive">
				                    <tr>
                                        <td class="hidden-xs-portrait">
                                        	${receive.receive_id}
                                        </td>
                                        <td class="book-img-box" style="position:relative;cursor:pointer;">
                                        	<div class="big_img_box" style="right: -150%;top: -45%;">
                                        		<img src="${pageContext.request.contextPath}/img/book/${receive.book_imgsrc}"/>
                                        	</div>
                                        	<img src="${pageContext.request.contextPath}/img/book/${receive.book_imgsrc}" width="90px" height="110px" />
                                        </td>
                                        <td>
                                        	${receive.book_name}
                                        </td>
                                        <td>
                                        	${receive.typename}
                                        </td>
                                        <td>
                                        	${receive.press_name}
                                        </td>
                                        <td>
                                        	${receive.put_id}
                                        </td>
                                        <td> 
                                        	${receive.class_name}
                                        </td>
                                        <td class="hidden-xs-portrait">
                                            ${receive.receive_number}
                                        </td>
                                        <td class="hidden-xs"> 
                                        	${receive.receive_time}
                                        </td>
                                        <td class="model-control" style="padding: 4% 8px;">
                                        	<form action="${pageContext.request.contextPath}/ClassRemove" method='get' onsubmit="return confirm('确定要删除这条记录吗？')" >
                                        		<input type='hidden' name="receive_id" value="${receive.receive_id}" />
                                        		<button type='submit' class="btn btn-danger btn-small">
                                        			<i class="btn-icon-only icon-remove"> </i>
                                        		</button>
                                        	</form>
                                        </td>
				                    </tr>
			                    </c:forEach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 版心 /-->

    <!-- 底部 -->
    <%@ include file="./model/footer.jsp" %>
    <!-- 底部 /-->
    <script type="text/javascript" src="js/index.js"></script>
    <script>
        var target = '${target}'
        toggleStyleLeftNav(parseInt(target))

        for(let i =0;i < jQuery('.book-img-box').length;i++){
	    	jQuery(jQuery('.book-img-box')[i]).on('mouseover',function (){
	    		jQuery(jQuery('.big_img_box')[i]).stop().fadeIn()
	    	})
	    	jQuery(jQuery('.book-img-box')[i]).on('mouseout',function (){
	    		jQuery(jQuery('.big_img_box')[i]).stop().fadeOut()
	    	})
	    }
        
        function toggleStyleLeftNav(index) {
            jQuery(jQuery('#nav li')).removeClass("current")
            jQuery(jQuery('#nav li')[index]).addClass("current")
        }
    </script>
</body>

</html>